<%@ page language="java" contentType="text/html;charset=utf-8" pageEncoding="utf-8"%>

<%@ include file="/core/taglibs.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
  
<head>  
	    
    <%@ include file="/core/memberMeta.jsp"%>
    <!-- 防止重复提交 -->
	<script type="text/javascript"> 
		var checkSubmitFlg = false; 
		
		
		function checkSubmit() {  
			if ($("#loginName").val() == "") {
				alert("请输入用户名。");
				 
				return false;
			}  
			
			if ($("#onePassword").val().length < 6) {
				alert("登陆密码不够六位");
				
				return false;
			}
			if ($("#onePasswordRec").val() != $("#onePassword").val()) {
				alert("两次一级密码不一样");
				
				return false;
			}
			if ($("#twoPassword").val().length < 6) {
				alert("安全密码不够六位");
				
				return false;
			}
			if ($("#twoPassword").val() != $("#twoPasswordRec").val()) {
				alert("两次安全密码不一样");
				
				return false;
			}
			
			 
			
			if (checkSubmitFlg == true) {   
				return false;   
			}   
			checkSubmitFlg = true;   
			return true;   
		}   
		document.ondblclick = function docondblclick() {   
			window.event.returnValue = false;   
		}   
		document.onclick = function doconclick() {   
			if (checkSubmitFlg) {   
				window.event.returnValue = false;   
			}   
		}   
	</script>
	<script type="text/javascript">
			 
		function recommendChange(){
			
			var recommendLoginName=$("#recommendLoginName").val(); 	
			 
			$.getJSON("<%=basePath%>/member/member/ajaxGetRecommendByName.shtml",{recommendLoginName: recommendLoginName},function(result){	 
				//填入新值
				if(result.success==true){
					
					$("#recommendPersonName").html("推荐人存在，姓名:"+result.member.personName);
				}else{
					 
					$("#recommendPersonName").html("<b  style='color: red;'>推荐人不存在</b>");
				}
				 
			});
		}
		
		function centerChange(){
			
			var centerLoginName=$("#centerLoginName").val(); 	
			 
			$.getJSON("<%=basePath%>/member/member/ajaxGetCenterByName.shtml",{centerLoginName: centerLoginName},function(result){	 
				//填入新值
				if(result.success==true){
					
					$("#centerPersonName").html("服务中心姓名:"+result.member.personName);
				}else{
					 
					$("#centerPersonName").html("<b  style='color: red;'>该会员不是服务中心</b>");
				}
				 
			});
		}
		
		function fatherChange(){
			
			var fatherLoginName=$("#fatherLoginName").val(); 	
			 
			$.getJSON("<%=basePath%>/member/member/ajaxGetFatherByName.shtml",{fatherLoginName: fatherLoginName},function(result){	 
				//填入新值
				if(result.success==true){
					
					$("#fatherPersonName").html("接点人姓名:"+result.member.personName);
				}else{
					 
					$("#fatherPersonName").html("<b  style='color: red;'>接点人不存在</b>");
				} 
				 
			});
		}
		
		function loginNameChange(){
			
			var loginName=$("#loginName").val(); 	
			 
			$.getJSON("<%=basePath%>/member/member/ajaxGetMemberByName.shtml",{loginName: loginName},function(result){	 
				//填入新值
				if(result.success==true){
					
					$("#loginNamePersonName").html("<b  style='color: blue;'>账号名可以用</b>");
				}else{
					$("#loginNamePersonName").html("<b  style='color: red;'>账号名已经存在</b>");
				}
				 
				
				 
			});
			 
			
		}
	</script>
</head>
<body>
   
     <div class="container">
            
       	<div class="mws-panel grid_8"  >
           	   <div class="mws-panel-header">
               		<span class="mws-i-24 i-user" style="font-weight:bold;font-size: 14px;">注册会员</span>
               </div>
               <div class="mws-panel-body">
                   <div class="mws-wizard clearfix">
                       <ul>
                           <li>
                               <a class="mws-ic-16 ic-house" href="#" style="font-weight:bold;font-size: 14px;color: black;">首 页</a>
                           </li>
                           <li>
                               <span  class="mws-ic-16 ic-user" style="font-weight:bold;font-size: 14px;color: black;">注册会员</span>
                           </li>
                           
                       </ul>
                   </div>
               </div>
              
               <div class="mws-panel-body">
 <form id="commitForm" action="member/member/memberAdd.shtml"  class="mws-form" method="post" onsubmit="return checkSubmit();" >				    
               <jodd:form scopes="request" beans="member">
               		<table class="mws-table">
                        
                       <tbody>
                       		
                            <tr> 
	                        	<td style="text-align: right;font-weight:bold;font-size: 14px;width: 20%;">会员账号：</td>
	                        	<td style="text-align: left;font-weight:bold;font-size: 14px;width:30%;">
	                            	<input type="text"  id="loginName" name="loginName"  class="mws-textinput"  onchange="loginNameChange()"/>
									<span id="loginNamePersonName"></span>
	                           </td>
	                         
	                        	<td style="text-align: right;font-weight:bold;font-size: 14px;width: 20%;">会员级别： </td>
	                        	<td style="text-align: left;font-weight:bold;font-size: 14px;width:30%;">
	                            	<select type="select" id="dailiId" name="dailiId" class="mws-textinput" onchange="change()">
										<c:forEach items="${dailiList}" var="o">
											<option value="${o.id}">
												${o.title}(${o.payNum})
											</option>
										</c:forEach>
									</select>
	                            </td>
	                       </tr>
	                       <tr>
	                        	<td style="text-align: right;font-weight:bold;font-size: 14px;" >推荐人编号：   </td>
	                        	<td style="text-align: left;font-weight:bold;font-size: 14px;">
	                            	<input type="text"  id="recommendLoginName" name="recommendLoginName" class="mws-textinput"  onchange="recommendChange()"/>
									<span id="recommendPersonName"></span>
	                            	
	                            </td>
	                       
	                        	<td style="text-align: right;font-weight:bold;font-size: 14px;" >服务中心编号： </td>
	                        	<td style="text-align: left;font-weight:bold;font-size: 14px;">
	                            	<input type="text"  id="centerLoginName" name="centerLoginName" class="mws-textinput"    onchange="centerChange()"/>
									<span id="centerPersonName"></span>
	                            	
	                           </td>
	                       </tr>
	                        <tr>
	                        	<td style="text-align: right;font-weight:bold;font-size: 14px;" >接点人编号：</td>
	                        	<td style="text-align: left;font-weight:bold;font-size: 14px;">
	                            	<input type="text"  id="fatherLoginName" name="fatherLoginName" class="mws-textinput"    onchange="fatherChange()"/>
									<span id="fatherPersonName"></span>
	                            	
	                            </td>
	                         
	                        	<td style="text-align: right;font-weight:bold;font-size: 14px;" >所在区域：  </td>
	                        	<td style="text-align: left;font-weight:bold;font-size: 14px;">
	                            	<c:if test="${qu!=null&&qu!=''}">
										<c:if test="${qu=='1'}">
											<input type="radio" name="qu" value="1" checked="checked" />接点人的左区
											 
											<input type="radio" name="qu" value="2"  />接点人的右区
											 
										</c:if>
										<c:if test="${qu=='2'}">
											<input type="radio" name="qu" value="1" />接点人的左区
											 
											<input type="radio" name="qu" value="2" checked="checked"  />接点人的右区
											 
										</c:if>
									</c:if>
									<c:if test="${qu==null||qu==''}">
										<input type="radio" name="qu" value="1" checked="checked" />接点人的左区
										 
										<input type="radio" name="qu" value="2"  />接点人的右区
										 
									</c:if>
	                           </td>
	                       </tr>
	                       <tr>
								<td style="text-align: right;font-weight:bold;font-size: 14px;width: 20%;">
									登陆密码：
								</td>
								<td style="text-align: left;font-weight:bold;font-size: 14px;">
									<input type="password" id="onePassword" name="onePassword"   />
									 <span style="color: red">(*必填6位以上)</span>
									 
								</td>
							
								<td style="text-align: right;font-weight:bold;font-size: 14px;width: 20%;">
									确认登陆密码：
								</td>
								<td style="text-align: left;font-weight:bold;font-size: 14px;">
									<input type="password" id="onePasswordRec"  
										name="onePasswordRec" />
									 <span style="color: red">(*必填6位以上)</span>
									 
								</td>
							</tr>
							<tr>
								<td style="text-align: right;font-weight:bold;font-size: 14px;width: 20%;">安全密码：</td>
								<td style="text-align: left;font-weight:bold;font-size: 14px;">
								<input type="password" id="twoPassword" name="twoPassword" /> <span style="color: red">(*必填6位以上)</span></td>
							
								<td style="text-align: right;font-weight:bold;font-size: 14px;width: 20%;">确认安全密码：</td>
								<td style="text-align: left;font-weight:bold;font-size: 14px;"><input type="password" id="twoPasswordRec" name="twoPasswordRec" /> <span style="color: red">(*必填6位以上)</span></td>
							</tr>
							<tr> 
							
								<td style="text-align: right;font-weight:bold;font-size: 14px;width: 20%;">手机号码：</td>
								<td style="text-align: left;font-weight:bold;font-size: 14px;">
									<input type="text"  id="tel" name="tel" /> 
								</td>
								<td style="text-align: right;font-weight:bold;font-size: 14px;width: 20%;">姓名：</td>
								<td style="text-align: left;font-weight:bold;font-size: 14px;">
									<input type="text"  id="personName" name="personName" /> 
								</td>
							</tr>
						   <tr> 
							
								<td style="text-align: right;font-weight:bold;font-size: 14px;width: 20%;">微信：</td>
								<td style="text-align: left;font-weight:bold;font-size: 14px;">
									<input type="text"  id="wei" name="wei" /> 
								</td>
								<td style="text-align: right;font-weight:bold;font-size: 14px;width: 20%;">QQ：</td>
								<td style="text-align: left;font-weight:bold;font-size: 14px;">
									<input type="text"  id="qq" name="qq" /> 
								</td>
							</tr>
							<tr> 
							
								<td style="text-align: right;font-weight:bold;font-size: 14px;width: 20%;">身份证：</td>
								<td style="text-align: left;font-weight:bold;font-size: 14px;">
									<input type="text"  id="cardNo" name="cardNo" /> 
								</td>
								<td style="text-align: right;font-weight:bold;font-size: 14px;width: 20%;">地址：</td>
								<td style="text-align: left;font-weight:bold;font-size: 14px;">
									<input type="text"  id="remark" name="remark" /> 
								</td>
							</tr>
							<tr>
								<td style="text-align: right;font-weight:bold;font-size: 14px;" >开户行：</td>
								<td style="text-align: left;font-weight:bold;font-size: 14px;">
									<select id="bankName" name="bankName" >
										<option value="中国银行">中国银行</option>
									  	<option value="农业银行">农业银行</option>
									  	<option value="交通银行">交通银行</option>
									  	<option value="建设银行">建设银行</option>
									  	<option value="工商银行">工商银行</option>
									  	<option value="招商银行">招商银行</option>
									  	<option value="邮政储蓄银行">邮政储蓄银行</option>
									  	<option value="光大银行">光大银行</option>
									  	<option value="民生银行">民生银行</option>
									  	<option value="平安银行">平安银行</option>
									  	<option value="中信银行">中信银行</option>
									</select>
									<span style="color: red">(*必填)</span>
								</td >
								 
							 
								<td style="text-align: right;font-weight:bold;font-size: 14px;" >开户名：</td>
								<td style="text-align: left;font-weight:bold;font-size: 14px;">
									 	<input type="text" id="bankPersonName" name="bankPersonName"  />
										<span style="color: red">(*必填)</span> 
								</td >
							</tr>
							<tr>
								<td style="text-align: right;font-weight:bold;font-size: 14px;" >银行卡号：</td>
								<td style="text-align: left;font-weight:bold;font-size: 14px;">
									 	<input type="text" id="bankCardNo" name="bankCardNo"  />
										<span style="color: red">(*必填)</span>
								</td >
							 
								<td style="text-align: right;font-weight:bold;font-size: 14px;" >开户行省份：</td>
								<td style="text-align: left;font-weight:bold;font-size: 14px;">
									 <input type="text" id="bankSheng" name="bankSheng"   />
									 <span style="color: red">(*必填)</span>
								</td >
							</tr>
							
							 
							<tr>
								<td style="text-align: right;font-weight:bold;font-size: 14px;" >开户行地市：</td>
								<td style="text-align: left;font-weight:bold;font-size: 14px;">
									 <input type="text" id="bankShi" name="bankShi" /> 
									 <span style="color: red">(*必填)</span>
								</td >
						 
								<td style="text-align: right;font-weight:bold;font-size: 14px;" >开户行详细地址：</td>
								<td style="text-align: left;font-weight:bold;font-size: 14px;">
									 <input type="text" id="bankAddress" name="bankAddress"  />
									 <span style="color: red">(*必填)</span>
								</td >
							</tr>
							 
						  
							 
							<tr>
								<td colspan="4">
									<div style="color: red;text-align:center;">
										<div style="color:red;text-align:center">
											${retMsg}
										</div>
									</div>
								</td>
							</tr>
							<tr>
	 							<td style="text-align: center;" colspan="4">
									<input type="submit" id="btn-2" class="mws-button green" value="提 交" style="font-size: 16px;font-weight: bold;width: 80px;"/>
                        			<input type="reset" id="btn-1" class="mws-button red" value="重 置" style="font-size: 16px;font-weight: bold;width: 80px;" />
                        	
								</td>
					  
							</tr>
							
                       </tbody>
                   </table>
               
                   
                </jodd:form>    
</form> 
        		</div>
        	 

           </div>
       </div>   
    
</body>

</html>


